// /*
//  * @Author: WanYiMing
//  * @Date:2024-05-24-15:38
//  * @Description:
//  */

using System;
using System.Collections.Generic;
using System.Linq;
using Code.DataManager.Model;
using Code.GameLogic.BaseClass.Model;
using Code.GameLogic.XianJian.UI;

namespace Code.DataManager.Converter
{
    public class XianJianUIConvertImpl:ISettingConvert<Dictionary<string, XianJianUIBo>,XianJianUIJsonBo>
    {
        public Dictionary<string, XianJianUIBo> ConvertToBo(XianJianUIJsonBo monsterJsonBo)
        {
            throw new NotImplementedException();
        }

        public Dictionary<string, XianJianUIBo> ConvertToBo(XianJianUIJsonBo xianJianUIJsonBo, Dictionary<string, XianJianUIBo> result)
        {
            XianJianUIJsonBo.XianJian[] XianJianList = xianJianUIJsonBo.xianJianUIList;
            for (int i = 0; i < XianJianList.Length; i++)
            {
                XianJianUIBo xianJianUIBo = Convert(XianJianList[i]);
                result[xianJianUIBo.BaseDescription.TypeCode] = xianJianUIBo;
            }
            return result;
        }
        
        
        private XianJianUIBo Convert(XianJianUIJsonBo.XianJian xianJian)
        {
            XianJianUIBo xianJianUIBo = new XianJianUIBo(new BaseDescription(xianJian.type, xianJian.name));
            xianJianUIBo.Act = xianJian.act;
            xianJianUIBo.Asp = xianJian.asp;
            xianJianUIBo.ActArea = xianJian.actArea;
            xianJianUIBo.CoverArea = xianJian.coverArea;
            xianJianUIBo.XianJianBehaviorList = xianJian.XianJianBehavior.Split("|").ToList();
            return xianJianUIBo;            
        }
        
    }
}